import axios from 'axios'
class res{
    constructor(opts={}){
        opts.baseURL = 'http://10.0.31.157:8888'
        opts.timeout = opts.timeout || 5000
        this.opts = opts
    }
    getInstance(opts={}){
        let options = {...this.opts,...opts}
        return axios.create(options) 
    }
    get(url,data={},opts={}){
        return this.getInstance(opts).get(url,{params:data})
    }
    post(url,data={},opts={}){
        return this.getInstance(opts).post(url,data)
    }
}

export default new res()